<template>
  <div class="boxs">
    <div class="boxs-top"><titles :title="props.info.text" /> <textMax :data="props.info.remarks" :maxLen="120" /></div>
    <t-row :gutter="20">
      <t-col :span="3" v-for="(item, index) in props.info.children" :key="index" @click="pathChild(item)">
        <!-- <img
          class="box-img"
          :class="{ 'img-alone': index % 2 !== 0 }"
          src="http://101.34.143.36:8890/api/image/387939155165253"
          alt=""
        /> -->
        <img
          class="box-img"
          :class="{ 'img-alone': index % 2 !== 0 }"
          :src="urls + item.value + '?imageView2/1/w/280/h/560/format/webp'"
          alt=""
          v-if="item.value"
        />

        <img
          class="box-img"
          :class="{ 'img-alone': index % 2 !== 0 }"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_560,w_280"
          alt=""
          v-else
        />
      </t-col>
    </t-row>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.boxs-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}
.box-img {
  width: 100%;
  height: auto;
}
.img-alone {
  margin-top: 80px;
}
</style>
